<template>
	<view class="">
		<view class="input margin17 bgcfff">
			<input type="text" placeholder="输入签名码或UUID搜索">
		</view>
		<view class="softItem margin17 bgcfff">
			<label class="pos" v-if="!showEdit">
				<checkbox value="" checked="isAll" />
			</label>
			<view class="softItem-left">
				<img src="../../static/wx.png" alt="">
			</view>
			<view class="softItem-middle">
				<view class="softItem-middle-top">
					微信定制
				</view>
				<view class="softItem-middle-middle">
					com.uneed.yunis
				</view>
				<view class="softItem-middle-bottom">
					2020-12-23 12:34:01
				</view>
			</view>
			<view class="softItem-right">
				<button>复制</button>
				<button>下载</button>
			</view>
		</view>
		<view class="softItem margin17 bgcfff">
			<label class="pos" v-if="!showEdit">
				<checkbox value="" checked="isAll" />
			</label>
			<view class="softItem-left">
				<img src="../../static/wx.png" alt="">
			</view>
			<view class="softItem-middle">
				<view class="softItem-middle-top">
					微信定制
				</view>
				<view class="softItem-middle-middle">
					com.uneed.yunis
				</view>
				<view class="softItem-middle-bottom">
					2020-12-23 12:34:01
				</view>
			</view>
			<view class="softItem-right">
				<button>复制</button>
				<button>下载</button>
			</view>
		</view>
		<view class="softItem margin17 bgcfff">
			<label class="pos" v-if="!showEdit">
				<checkbox value="" checked="isAll" />
			</label>
			<view class="softItem-left">
				<img src="../../static/wx.png" alt="">
			</view>
			<view class="softItem-middle">
				<view class="softItem-middle-top">
					微信定制
				</view>
				<view class="softItem-middle-middle">
					com.uneed.yunis
				</view>
				<view class="softItem-middle-bottom">
					2020-12-23 12:34:01
				</view>
			</view>
			<view class="softItem-right">
				<button>复制</button>
				<button>下载</button>
			</view>
		</view>
		<view class="edit">
			<view class="edit-left" v-if="!showEdit" @tap="checkAll">
				<label class="margin17">
					<checkbox value="" checked="isAll" />全选
				</label>
				<view class="margin17">复制</view>
				<view class="margin17">删除</view>
			</view>
			<button v-if="showEdit" @tap="edit">编辑</button>
			<button v-if="!showEdit" @tap="finish">完成</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showEdit: true,
				isAll: false
			}
		},
		methods: {
			edit(){
				this.showEdit = false
				let item = document.querySelectorAll('.softItem')
				item.forEach((a)=>{
					a.classList.add('marginLeft50')
				})
			},
			finish(){
				this.showEdit = true
				let item = document.querySelectorAll('.softItem')
				item.forEach((a)=>{
					a.classList.remove('marginLeft50')
				})
			},
			checkAll() {
				this.isAll = !this.isAll
			}
		}
	}
</script>

<style lang="scss">
	.input {
		position: relative;
		height: 88upx;
		margin-top: 40upx;
		margin-bottom: 50upx;
		border-radius: 40upx;
		display: flex;
		align-items: center;

		input {

			margin-left: 90upx;
		}

		&:before {
			content: '';
			position: absolute;
			width: 40upx;
			height: 40upx;
			left: 30upx;
			background: url(../../static/icon/search.svg);
			background-size: contain;
		}

		&::after {
			content: '查询';
			position: absolute;
			right: 30upx;
			color: #4188FD;
			font-weight: 500;
		}
	}

	.softItem {
		display: flex;
		height: 212upx;
		margin-top: 30upx;
		padding: 0 30upx;
		border-radius: 20upx;
		align-items: center;
		justify-content: space-between;

		&-left {
			width: 140upx;
			height: 140upx;
			border-radius: 10upx;
			overflow: hidden;

			img {
				width: 100%;
				height: 100%;
			}
		}

		&-middle {
			flex: auto;
			margin-left: 20upx;

			&-top {
				// margin-top: -10upx;
			}

			&-middle {
				margin-bottom: 10upx;
			}

			&-bottom {
				color: #939393;
				font-size: 24upx;
			}
		}

		&-right {
			display: flex;
			flex-direction: column;

			button {
				width: 61px;
				height: 24px;
				margin: 12upx 0;
				border-radius: 30px;
				background: #FFFFFF;
				box-sizing: border-box;
				border: 2upx solid #3276F3;
				font-size: 24upx;

				&:first-child {
					color: #3276F3;
				}

				&:last-child {
					color: #FFFFFF;
					background-color: #0086FF;
				}
			}
		}
	}

	.edit {
		position: fixed;
		display: flex;
		width: 100%;
		height: 154upx;
		bottom: 0;
		align-items: center;
		background: #FFFFFF;
		box-shadow: 0px -6px 28px 0px rgba(197, 197, 197, 0.3);
		color: #4188FD;

		button {
			position: absolute;
			width: 146upx;
			height: 72upx;
			right: 56upx;
			line-height: 72upx;
			border-radius: 154upx;
			background: #FFFFFF;
			box-sizing: border-box;
			border: 1px solid #3276F3;
		}

		&-left {
			display: flex;

		}
	}
	
	.marginLeft50{
		margin-left: 100upx !important;
	}
	
	.pos{
		position: absolute;
		left: 36upx;
	}
	/deep/uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked,
	/deep/uni-checkbox .uni-checkbox-input
	{
		width: 34upx;
		height: 34upx;
		border-radius: 22px;
		border: 1px solid;
	}
</style>